import java.util.Scanner;

public class Demo23 {
    private volatile static int count = 0;
    public static void main(String[] args){
        Thread t1 = new Thread(() -> {
           while(count == 0){
//               try {
//                   Thread.sleep(1000);
//               } catch (InterruptedException e) {
//                   throw new RuntimeException(e);
//               }
           }
            System.out.println("t1 执行结束");
        });

        Thread t2 = new Thread(() -> {
            Scanner sc = new Scanner(System.in);
            System.out.println("请输入一个整数：");
            count = sc.nextInt();
        });

        t1.start();
        t2.start();
    }
}
